<h1><%= title "Towns" %></h1>

<table>
  <tr>
    <th>Name</th>
    <th>County</th>
	<th>Ruler</th>
    <th>Infrastructure</th>
  </tr>

<% for town in @towns %>
  <tr>
    <td><%=h town.name %></td>
    <td><%=link_to_record town.county %></td>
	<td><%=link_to_record Title.earl_of town %></td>
    <td><%=h town.infrastructure %></td>
    <td><%= link_to 'Show', town %></td>
    <td><%= link_to 'Edit', edit_town_path(town) %></td>
    <td><%= link_to 'Destroy', town, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New town', new_town_path %> | <%= link_to 'Home', '/' %>
